package com.example.jc.retrofit

import retrofit2.Call
import retrofit2.Retrofit
import retrofit2.converter.scalars.ScalarsConverterFactory
import retrofit2.http.GET
import retrofit2.http.Query

/**
 * XiaoYao,万家灯火 华灯初上
 * @Description:
 * @Author: 肖垚 1094890313@qq.com
 * @create: 2021年11月18日 18:02
 * @Version 1.0
 **/
private const val BASE_URL = "https://mars.udacity.com/"
//private const val BASE_URL = "http://192.168.2.41:9001/api/test/v1/"

private val retrofit = Retrofit.Builder()
    .addConverterFactory(ScalarsConverterFactory.create())
    .baseUrl(BASE_URL)
    .build()

interface MarsApiService {
    @GET("realestate")
// @GET("get")
    fun getProperties(@Query("filter") type: String):
            Call<String>
}

object MarsApi {
    val retrofitService: MarsApiService by lazy {
        retrofit.create(MarsApiService::class.java)
    }
}